package com.ruoyi.common.enums;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;

import java.io.IOException;

/**
 * controller层序列化枚举
 */
public class BaseStringSerializer extends StdSerializer<BaseString> {

    public BaseStringSerializer() {
        super(BaseString.class);
    }

    @Override
    public void serialize(BaseString value, JsonGenerator gen, SerializerProvider provider)
            throws IOException {
        gen.writeString(value.getCode());
    }
}